package com.yonyou.cyxdms.sysmanage.client.feign;

import java.util.List;
import java.util.Map;
import java.util.Set;

import com.yonyou.cyxdms.sysmanage.client.domains.dto.*;
import com.yonyou.cyxdms.sysmanage.client.vo.role.RoleVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse;
import com.yonyou.cyxdms.framework.bean.dto.emp.UserDTO;
import com.yonyou.cyxdms.framework.bean.dto.push.PushDTO;
import com.yonyou.cyxdms.framework.bean.dto.user_info.LoginInfoDto;
import com.yonyou.cyxdms.sysmanage.client.config.FeiginHeaderManageConfig;
import com.yonyou.cyxdms.sysmanage.client.vo.advice.AdviceRuleVO;
import com.yonyou.cyxdms.sysmanage.client.vo.company.CompanyDealerAscVO;
import com.yonyou.cyxdms.sysmanage.client.vo.company.CompanyOrgMaintenanceTreeVO;
import com.yonyou.cyxdms.sysmanage.client.vo.company.CompanyOrgVO;
import com.yonyou.cyxdms.sysmanage.client.vo.company.CompanyVO;
import com.yonyou.cyxdms.sysmanage.client.vo.dealer.DealerInfoAVO;
import com.yonyou.cyxdms.sysmanage.client.vo.dealer.DealerInfoParentVO;
import com.yonyou.cyxdms.sysmanage.client.vo.dealer.DealerOrAscOrCompanyVO;
import com.yonyou.cyxdms.sysmanage.client.vo.dealer.DealerOrgAreaVO;
import com.yonyou.cyxdms.sysmanage.client.vo.dealer.DealerPictureVO;
import com.yonyou.cyxdms.sysmanage.client.vo.employee.EmployeeOrgsVO;
import com.yonyou.cyxdms.sysmanage.client.vo.employee.EmployeeVO;
import com.yonyou.cyxdms.sysmanage.client.vo.employee.UserInfoVO;
import com.yonyou.cyxdms.sysmanage.client.vo.org.OrgAndParentVO;
import com.yonyou.cyxdms.sysmanage.client.vo.org.OrgParentVO;
import com.yonyou.cyxdms.sysmanage.client.vo.role.UserbyRoleVO;
import com.yonyou.cyxdms.sysmanage.client.vo.user.RoleUserVo;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * feign
 *
 * @author: renwd
 * @since: 2018/11/27
 * @version:1.0 Copyright: Copyright (c) 2018
 */

@FeignClient(value = "sysmanage-service", configuration = FeiginHeaderManageConfig.class)
public interface SysmanageDataCommonClient {

    /**
     * 查询品牌信息
     *
     * @param userId 查询条件
     * @return java.util.List<LoginInfoDto>
     * @author maxingjian
     * @since 2019/08/13
     */
    @GetMapping(value = "/login/getLoginInfoNew2")
    public RestResultResponse<LoginInfoDto> getLoginInfo(@RequestParam(value = "userId") String userId,
                                                         @RequestParam(value = "userAgent") String userAgent,
                                                         @RequestParam(value = "flag") boolean flag);


    /**
     * 查询职责
     *
     * @param userId 查询条件
     * @return String
     * @author maxingjian
     * @since 2019/08/13
     */
    @GetMapping(value = "/login/getRole", produces = "application/json;charset=UTF-8")
    public RestResultResponse<String> getRole(@RequestParam(value = "userId") String userId);

    /**
     * 设置职责
     *
     * @param userId 查询条件
     * @return String
     * @author maxingjian
     * @since 2019/08/13
     */
    @GetMapping(value = "/login/setRoleWithId", produces = "application/json;charset=UTF-8")
    public RestResultResponse<String> setRole(@RequestParam(value = "appRole") String appRole, @RequestParam(value = "userId") String userId);

    /**
     * 版本
     *
     * @param appType 查询条件
     * @return Map
     * @author maxingjian
     * @since 2019/08/13
     */
    @GetMapping(value = "/login/appVersionNo", produces = "application/json;charset=UTF-8")
    public RestResultResponse<Map<String, String>> appVersionNo(@RequestParam(value = "appType") String appType, @RequestParam(value = "appId") String appId);

    @GetMapping(value = "/login/emp")
    public RestResultResponse<EmpDTO> emp(@RequestParam(value = "appId") String appId, @RequestParam(value = "employeeNo") String employeeNo);

    @RequestMapping(method = RequestMethod.POST, value = "/login/userByCondition", produces = "application/json;charset=UTF-8")
    public RestResultResponse<List<UserDTO>> userByCondition(@RequestBody UserDTO userDTO);

    @RequestMapping(method = RequestMethod.POST, value = "/login/pushByUserIdOrEmpNo", produces = "application/json;charset=UTF-8")
    public RestResultResponse<String> pushByUserIdOrEmpNo(@RequestBody PushDTO pushDTO);

    @RequestMapping(method = RequestMethod.GET, value = "/login/getRoles", produces = "application/json;charset=UTF-8")
    public RestResultResponse<Map<String, Object>> getRoles(@RequestParam(value = "employeeNo") String employeeNo);


    @RequestMapping(method = RequestMethod.GET, value = "/basedata/employees/getEmployeeById", produces = "application/json;charset=UTF-8")
    public RestResultResponse<EmployeeDictDto> getEmployeeById(@RequestParam(value = "employeeId") Long employeeId);

    @RequestMapping(method = RequestMethod.GET, value = "/basedata/users/getUserById", produces = "application/json;charset=UTF-8")
    public RestResultResponse<UserDictDto> getUserById(@RequestParam(value = "userId") Long userId);

    @RequestMapping(method = RequestMethod.GET, value = "/basedata/users/getUserByIdCMS", produces = "application/json;charset=UTF-8")
    public RestResultResponse<UserDictDto> getUserByIdCMS(@RequestParam(value = "userId") Long userId);

    /**
     * 根据角色类别获取用户信息
     *
     * @param role 角色类别
     * @return
     * @author 李贺
     * @since 2019/9/9
     */
    @RequestMapping(value = "/basedata/users/getUserListByRole", method = RequestMethod.GET)
    public RestResultResponse<List<UserAndRoleDTO>> getUserListByRole(
            @ApiParam(name = "role", value = "角色类别", required = false) @RequestParam(value = "role") Integer role);

    @RequestMapping(method = RequestMethod.GET, value = "/basedata/employees/findAuthorization", produces = "application/json;charset=UTF-8")
    public RestResultResponse<String> findAuthorization(@ApiParam(name = "menuId", value = "菜单id") @RequestParam(value = "menuId", defaultValue = "") Long menuId,
                                                        @ApiParam(name = "alias", value = "别名") @RequestParam(value = "alias", defaultValue = "") String alias,
                                                        @ApiParam(name = "salesColumn", value = "销售人员") @RequestParam(value = "salesColumn", defaultValue = "") String salesColumn,
                                                        @ApiParam(name = "orgColumn", value = "组织") @RequestParam(value = "orgColumn", defaultValue = "") String orgColumn);

    @RequestMapping(method = RequestMethod.GET, value = "/basedata/employees/findAuthorizationWithType", produces = "application/json;charset=UTF-8")
    public RestResultResponse<String> findAuthorization(@ApiParam(name = "menuId", value = "菜单id") @RequestParam(value = "menuId", defaultValue = "") Long menuId,
                                                        @ApiParam(name = "alias", value = "别名") @RequestParam(value = "alias", defaultValue = "") String alias,
                                                        @ApiParam(name = "salesColumn", value = "销售人员") @RequestParam(value = "salesColumn", defaultValue = "") String salesColumn,
                                                        @ApiParam(name = "orgColumn", value = "组织") @RequestParam(value = "orgColumn", defaultValue = "") String orgColumn,
                                                        @ApiParam(name = "isDealer", value = "是否经销商") @RequestParam(value = "isDealer", defaultValue = "") boolean isDealer);

    @RequestMapping(method = RequestMethod.GET, value = "/basedata/employees/findAuthorizationWithType2", produces = "application/json;charset=UTF-8")
    public RestResultResponse<String> findAuthorization(@ApiParam(name = "menuId", value = "菜单id") @RequestParam(value = "menuId", defaultValue = "") Long menuId,
                                                        @ApiParam(name = "alias", value = "别名") @RequestParam(value = "alias", defaultValue = "") String alias,
                                                        @ApiParam(name = "salesColumn", value = "销售人员") @RequestParam(value = "salesColumn", defaultValue = "") String salesColumn,
                                                        @ApiParam(name = "orgColumn", value = "组织") @RequestParam(value = "orgColumn", defaultValue = "") String orgColumn,
                                                        @ApiParam(name = "isDealer", value = "是否经销商") @RequestParam(value = "isDealer", defaultValue = "") boolean isDealer,
                                                        @ApiParam(name = "needSaleCode", value = "是否需要销售code") @RequestParam(value = "needSaleCode", defaultValue = "") boolean needSaleCode,
                                                        @ApiParam(name = "needServiceCode", value = "是否需要售后code") @RequestParam(value = "needServiceCode", defaultValue = "") boolean needServiceCode);


    @RequestMapping(method = RequestMethod.GET, value = "/basedata/employees/findPermissionRangeByMenu", produces = "application/json;charset=UTF-8")
    public RestResultResponse<String> findPermissionRangeByMenu(@ApiParam(name = "menuId", value = "菜单id") @RequestParam(value = "menuId", defaultValue = "") Long menuId);


    @GetMapping(value = "/vehicleProduct/dealerBrand/queryBrandIdListByOwnerCode", produces = "application/json;charset=UTF-8")
    public RestResultResponse<List<Long>> queryBrandIdListByOwnerCode(@RequestParam(value = "ownerCode") String ownerCode);

    /**
     * 获取维修站简称
     *
     * @param
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author dengqiang
     * @since 2019/8/19
     */
    @GetMapping(value = "/dealerGroup/queryDealerShortname", produces = "application/json;charset=UTF-8")
    public RestResultResponse<List<Map<String, Object>>> queryDealerShortname();

    /**
     * 获取品牌ID列表
     *
     * @param
     * @return java.util.List<java.lang.Long>
     * @author dengqiang
     * @since 2019/8/19
     */
    @GetMapping(value = "/vehicleProduct/dealerBrand/queryBrandIdList", produces = "application/json;charset=UTF-8")
    RestResultResponse<List<Long>> queryBrandIdList();

    /**
     * 获取车系ID列表
     *
     * @author 李贺
     * @since 2019/12/11
     */
    @GetMapping(value = "/vehicleProduct/dealerBrand/querySeriesIdList")
    RestResultResponse<List<Long>> querySeriesIdList();

    /**
     * 获取所有员工
     *
     * @param
     * @return java.util.List<java.lang.Long>
     * @author 马邢健
     * @since 2019/9/04
     */
    @GetMapping("/sysLogin/emp/getEmployees")
    public RestResultResponse<List<EmployeeVO>> getEmployees(@ApiParam(name = "queryCondition", value = "查询条件", required = false) @RequestParam(value = "queryCondition", required = false, defaultValue = "") String queryCondition);

    /**
     * 查询本组织下的销售人员
     *
     * @author 李贺
     * @since 2019/9/5
     */
    @GetMapping("/basedata/employees/getSalesman")
    public RestResultResponse<List<EmployeeOrgsVO>> getSalesman();

    /**
     * 获取登录用户公司信息
     *
     * @param:
     * @return:
     * @auther: 李贺
     * @since: 2019/9/6
     */
    @GetMapping("/dealerInfo/getDealerOrAscOrCompany")
    public RestResultResponse<DealerOrAscOrCompanyVO> getDealer(@RequestParam(value = "ownerCode", required = false) String ownerCode);

    /**
     * 获取登录用户公司信息通过code关联code或name
     *
     * @param:
     * @return:
     * @auther: luoyong
     * @since: 2022/4/6
     */
    @GetMapping("/dealerInfo/getCompanyByCodeOrName")
    public RestResultResponse<DealerOrAscOrCompanyVO> getCompanyByCode(@RequestParam(value = "ownerCode", required = false) String ownerCode);

    /**
     * 获取登录用户组织信息
     *
     * @auther: 李贺
     * @since: 2019/9/6
     */
    @GetMapping("/org/getOrg")
    public RestResultResponse<OrgAndParentVO> getOrg(@ApiParam(name = "orgId", value = "组织id") @RequestParam(value = "orgId") String orgId);

    /**
     * @param title
     * @param templateCode
     * @param templateContentMap
     * @return
     * @auther: adu
     */
    @RequestMapping(value = "/login/pushBy", method = RequestMethod.POST, produces =
            "application/json;charset=UTF-8")
    public RestResultResponse<Void> pushBy(@RequestParam(value = "title", required = true, defaultValue = "") String title,
                                           @RequestParam(value = "templateCode", required = true, defaultValue = "") Integer templateCode,
                                           @RequestParam(value = "userIds", required = true, defaultValue = "") Integer userIds,
                                           @RequestParam(value = "pageJumpParam", required = false) String pageJumpParam,
                                           @RequestBody Map<String, Object> templateContentMap
    );

    @RequestMapping(value = "/login/pushBys", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public RestResultResponse<Void> pushBys(
            @RequestParam(value = "kind", required = false, defaultValue = "") Integer kind,
            @RequestParam(value = "businessId", required = false, defaultValue = "") Integer businessId,
            @RequestParam(value = "orderId", required = false, defaultValue = "") String orderID,
            @RequestParam(value = "recordVersion", required = false, defaultValue = "") String recordVersion,
            @RequestParam(value = "actionId", required = false, defaultValue = "") String actionId,
            @RequestParam(value = "clueId", required = false, defaultValue = "") String clueId,
            @RequestParam(value = "clueType", required = false, defaultValue = "") String clueType,
            @RequestParam(value = "customerBusinessId", required = false, defaultValue = "") String customerBusinessId,
            @RequestParam(value = "dataType", required = false, defaultValue = "") String dataType,
            @RequestParam(value = "title", required = false, defaultValue = "") String title,
            @RequestParam(value = "templateCode", required = true, defaultValue = "") Integer templateCode,
            @RequestParam(value = "userIds", required = true) Integer userIds,
            @RequestBody Map<String, Object> templateContentMap
    );

    /**
     * 消息推送智慧通
     * @param kind
     * @param businessId
     * @param orderID
     * @param recordVersion
     * @param actionId
     * @param clueId
     * @param clueType
     * @param customerBusinessId
     * @param dataType
     * @param title
     * @param templateCode
     * @param userIds
     * @param templateContentMap
     * @return
     */
    @RequestMapping(value = "/login/pushBysZHT", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public RestResultResponse<Void> pushBysZHT(
            @RequestParam(value = "kind", required = false, defaultValue = "") Integer kind,
            @RequestParam(value = "businessId", required = false, defaultValue = "") Integer businessId,
            @RequestParam(value = "orderId", required = false, defaultValue = "") String orderID,
            @RequestParam(value = "recordVersion", required = false, defaultValue = "") String recordVersion,
            @RequestParam(value = "actionId", required = false, defaultValue = "") String actionId,
            @RequestParam(value = "clueId", required = false, defaultValue = "") String clueId,
            @RequestParam(value = "clueType", required = false, defaultValue = "") String clueType,
            @RequestParam(value = "customerBusinessId", required = false, defaultValue = "") String customerBusinessId,
            @RequestParam(value = "dataType", required = false, defaultValue = "") String dataType,
            @RequestParam(value = "title", required = false, defaultValue = "") String title,
            @RequestParam(value = "templateCode", required = true, defaultValue = "") Integer templateCode,
            @RequestParam(value = "userIds", required = true) Integer userIds,
            @RequestParam(value = "jwt", required = true, defaultValue = "") String jwt,
            @RequestBody Map<String, Object> templateContentMap
    );

    /**
     * 新增接口，保存公司表、经销商表、服务站表、组织表、组织关系表、
     * 人员表、用户表、员工表、职位表、角色表、app版本表、
     * 用户菜单表他的两个子表、员工菜单表以及他的两个子表。
     *
     * @author 李贺
     * @since 2019/9/10
     */
    @PutMapping("/company/org/addDealerCompany")
    public RestResultResponse<CompanyDealerAscVO> addDealerCompany(@RequestBody CompanyDealerAscVO companyDealerAscVO);

    /**
     * 新增多个公司
     *
     * @author 李贺
     * @since 2019/12/2
     */
    @PostMapping("/company/org/addDealerCompanyList")
    public RestResultResponse<List<CompanyDealerAscVO>> addDealerCompanyList(@RequestBody List<CompanyDealerAscVO> companyDealerAscVOList);

    /**
     * 更新接口，更新公司表、经销商表、服务站表
     *
     * @author 李贺
     * @since 2019/9/12
     */
    @PostMapping("/company/org/updateDealerCompany")
    public RestResultResponse<CompanyDealerAscVO> updateDealerCompany(@RequestBody CompanyDealerAscVO companyDealerAscVO);


    /**
     * 根据roleposition获取user
     *
     * @author MAXINGJIAN
     * @since 2019/9/18
     */
    @GetMapping("/basedata/roles/getUserInfoByRolePosition")
    public RestResultResponse<List<UserbyRoleVO>> getUserInfoByRolePosition(
            @ApiParam(name = "positionCode", value = "角色类别", required = false) @RequestParam(value = "positionCode", required = false, defaultValue = "") String positionCode,
            @ApiParam(name = "companyId", value = "公司id", required = false) @RequestParam(value = "companyId", required = false, defaultValue = "") String companyId,
            @ApiParam(name = "ownerCode", value = "经销商code", required = false) @RequestParam(value = "ownerCode", required = false, defaultValue = "") String ownerCode);

    /**
     * 根据role获取user
     *
     * @author MAXINGJIAN
     * @since 2019/9/18
     */
    @GetMapping("/basedata/roles/getUserInfoByRole")
    public RestResultResponse<List<UserbyRoleVO>> getUserInfoByRole(
            @ApiParam(name = "roleCode", value = "角色", required = true) @RequestParam(value = "roleCode") String roleCode,
            @ApiParam(name = "companyId", value = "公司id", required = false) @RequestParam(value = "companyId", required = false, defaultValue = "") String companyId);

    /**
     * 根据role获取user
     *
     * @author MAXINGJIAN
     * @since 2019/9/20
     */
    @GetMapping("/basedata/users/getUserInfoByUserId")
    public RestResultResponse<UserInfoVO> getUserInfoByUserId(@RequestParam(value = "userId") String userId);

    @RequestMapping(method = RequestMethod.POST, value = "/basedata/users/getUserInfoList", produces = "application/json;charset=UTF-8")
    RestResultResponse<List<UserInfoVO>> getUserInfoList(@RequestBody Set<String> userIdSet);

    /**
     * 根据MENUID查询用户
     *
     * @author MAXINGJIAN
     * @since 2019/9/20
     */
    @GetMapping("/basedata/employees/getDirSalesName")
    public List<EmployeeOrgsVO> getDirSalesName(@ApiParam(name = "menuId", value = "菜单id", required = true) @RequestParam(value = "menuId", required = true) String menuId
            , @ApiParam(name = "positionCode", value = "公司id", required = true) @RequestParam(value = "positionCode", required = true) String positionCode);

    @RequestMapping(method = RequestMethod.GET, value = "/basedata/users/getUserByIdCMSNew", produces = "application/json;charset=UTF-8")
    RestResultResponse<UserDictDto> getUserByIdCMSNew(@RequestParam(value = "userId") Long userId, @RequestParam("userOrgId") String userOrgId);

    /**
     * 供定时器使用
     *
     * @auther: 李贺
     * @since: 2019/9/18
     */
    @ApiOperation(value = "获取通知定时器设置", notes = "获取通知定时器设置")
    @GetMapping("/commonDatas/adviceRules")
    public RestResultResponse<List<AdviceRuleVO>> findAdviceRules(@ApiParam(name = "paramCode", value = "paramCode", required = true) @RequestParam(value = "paramCode", required = true) String paramCode);

    @GetMapping("/company/org/getCompany")
    public RestResultResponse<CompanyVO> getCompany(@ApiParam(name = "companyId", value = "companyId") @RequestParam(value = "companyId") Long companyId);


    @GetMapping("/basedata/users/getAppPosition")
    public RestResultResponse<Integer> getAppPosition();

    /**
     * @return
     * @auther: adu
     * @since 2019/10/25
     */
    @GetMapping("/basedata/users/getUsersByPosition")
    public RestResultResponse<List<com.yonyou.cyxdms.sysmanage.client.vo.user.UserInfoVO>>
    getUsersByPosition(@RequestParam(value = "menuId") Long menuId, @RequestParam(value = "positionCodes") List<Integer> positionCodes, @RequestParam(value = "userPhone", required = false) String userPhone);

    /**
     * 网销经理或网销顾问查询所属顾问
     *
     * @return
     * @auther: wy
     * @since 2020/04/06
     */
    @GetMapping("/basedata/users/getUsersByManager")
    public RestResultResponse<List<com.yonyou.cyxdms.sysmanage.client.vo.user.UserInfoVO>>
    getUsersByManager(@RequestParam(value = "menuId") Long menuId, @RequestParam(value = "positionCodes") List<Integer> positionCodes, @RequestParam(value = "userPhone", required = false) String userPhone);


    //------------------------------------------------------------- FEIGN调用迁移
    @GetMapping("/consultantWork/getWorkConsultant")
    RestResultResponse<Map<String, Integer>> getWorkConsultantByDealerCode(@RequestParam("ownerCode") String ownerCode,
                                                                           @RequestParam("sourceId") Long sourceId);

    @GetMapping("/consultantWork/getWorkConsultantRatio")
    RestResultResponse<Map<String, Integer>> getWorkConsultantRatioByDealerCode(@RequestParam("ownerCode") String ownerCode,
                                                                                @RequestParam("sourceId") Long sourceId);

    @GetMapping("/commonDatas/ownerRatio")
    String getRatioByownerCode(@RequestParam("companyId") Long companyId);

    @PutMapping("/consultantWork/updateConsultant")
    RestResultResponse<Integer> updateConsultantClues(@RequestParam("consultantId") String consultId,
                                                      @RequestParam("num") Integer num);

    @GetMapping("/emp/phone")
    RestResultResponse<Integer> getEmployeeByPhone(@RequestParam("phone") String phone,
                                                   @RequestParam("appId") String appId);

    @GetMapping("/emp/employeeName")
    RestResultResponse<List<Integer>> getEmployeeByEmployeeName(@RequestParam("employeeName") String employeeName);

    @PostMapping(value = "/login/pushBy")
    RestResultResponse<Void> pushBy(@RequestParam(value = "appRole", required = false, defaultValue = "") Integer appRole,
                                    @RequestParam(value = "businessId", required = false, defaultValue = "") Integer businessId,
                                    @RequestParam(value = "kind", required = false, defaultValue = "") Integer kind,
                                    @RequestParam(value = "extend1", required = false, defaultValue = "") String extend1,
                                    @RequestParam(value = "extend2", required = false, defaultValue = "") String extend2,
                                    @RequestParam(value = "userIds", required = false, defaultValue = "") Integer userIds,
                                    @RequestParam(value = "title", required = false, defaultValue = "") String title,
                                    @RequestParam(value = "templateCode", required = true, defaultValue = "") Integer templateCode,
                                    @RequestBody Map<String, Object> templateContentMap
    );

    @GetMapping("/dealerInfo/getDealerblackStatus")
    RestResultResponse<Boolean> getDealerblackStatus(@RequestParam("appId") String appId,
                                                     @RequestParam("ownerCode") String ownerCode);

    /**
     * 根据userID获取user信息
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/9/21
     */
    @RequestMapping(value = "/emp/getEmpInfoByUserId", method = RequestMethod.POST)
    RestResultResponse<Map<String, Map<String, String>>> getEmpInfoByUserId(@RequestBody List<String> userIds,
                                                                            @RequestParam("isContain") Boolean isContain,
                                                                            @RequestParam(value = "consultantId",
                                                                                    required = false) String consultantId,
                                                                            @RequestParam("appId") String appId,
                                                                            @RequestParam("ownerCode") String ownerCode);


    @GetMapping("/dealerInfo/getDealerInfoByCodes")
    RestResultResponse<List<Map<String, String>>> getDealerInfoByCodes(@RequestParam(value = "ownerCodes", required = false) List<String> ownerCodes,
                                                                       @RequestParam(value = "isBlack", required =
                                                                               false) Boolean isBlack,
                                                                       @RequestParam(value = "appId") String appId,
                                                                       @RequestParam(value = "ownerCode", required =
                                                                               false) String ownerCode,
                                                                       @RequestParam(value = "orgId", required =
                                                                               false) String orgId,
                                                                       @RequestParam(value = "currentPage", defaultValue = "1") Integer currentPage,
                                                                       @RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize);

    @GetMapping("/dealerInfo/getDealerHeightLevelCode")
    RestResultResponse<Map<String, String>> getDealerHeightLevelCode(@RequestParam("ownerCode") String ownerCode,
                                                                     @RequestParam("appId") String appId);


    /**
     * 查询经销商名称(根据appId和dearCode可以确定唯一性)
     *
     * @author dengqiang
     * @since 2019/5/16
     */
    @GetMapping(value = "/dealerInfo/getDealerName", produces = {"application/json;" +
            "charset=UTF-8"})
    public RestResultResponse<String> getDealerName(@RequestParam("appId") String appId,
                                                    @RequestParam("dealerCode") String dealerCode);

    /**
     * 根据手机号获取顾问的组织信息
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/10/21
     */
    @PostMapping("/emp/getOrginfoByPhone")
    public RestResultResponse<RoleUserVo> getOrginfoByPhone(@RequestBody RoleUserVo roleUserVo);

    @PostMapping("/emp/getOrgInfoByPhoneAndOwnerCode")
    public RestResultResponse<RoleUserVo> getOrgInfoByPhoneAndOwnerCode(@RequestBody RoleUserVo roleUserVo);


    /**
     * 通过userid查emp信息
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/10/22
     */
    @GetMapping("/emp/queryEmpInfoByuserId")
    @ApiOperation("通过userId查询对应顾问信息")
    public RestResultResponse<EmpDTO> queryEmpInfoByuserId(@RequestParam("userId") Long userId);

    /**
     * 根据条件查询经销商信息
     *
     * @auther: 李贺
     * @since: 2019/11/13
     */
    @GetMapping("/dealerInfo/getDealerInfos")
    RestResultResponse<List<DealerInfoParentVO>> getDealerInfos(@RequestParam(value = "orgId", required = false) Long orgId, @RequestParam(value = "provinceId", required = false) Long provinceId);

    /**
     * 通过userid查emp信息
     *
     * @param: userids
     * @return: map<userid, empdto>
     * @auther: tanjie
     * @since: 2019/10/22
     */
    /*
    @GetMapping("/emp/queryEmpInfoByUserIds")
    @ApiOperation("批量获取顾问信息")
    RestResultResponse<Map<Long, EmpDTO>> queryEmpInfoByUserIds(@RequestParam("ids") List<Long> ids);
    */
    @PostMapping("/emp/queryEmpInfoByUserIdsPost")
    @ApiOperation("批量获取顾问信息")
    RestResultResponse<Map<Long, EmpDTO>> queryEmpInfoByUserIds(@RequestBody List<Long> ids);

    /**
     * 查询用户职位
     * 李贺
     */
    @GetMapping(value = "/basedata/positions/getPositions")
    public RestResultResponse<List<Integer>> getPositions(@RequestParam(value = "userId", required = false) Long userId);

    /**
     * 根据用户的userOrgId查询责任线索来源
     * 张覃
     */
    @GetMapping(value = "/basedata/employees/findClueSourceids")
    public RestResultResponse<Map<String, String>> findClueSourceids(@RequestParam(value = "userOrgId", required = false) Long userOrgId);

    /**
     * 根据省市区查询经销商信息
     *
     * @auther: 李贺
     * @since: 2019/11/15
     */
    @GetMapping("/dealerInfo/getDealerInfosByCity")
    @ApiOperation("根据省市区查询经销商信息")
    RestResultResponse<List<DealerInfoParentVO>> getDealerByCity(@RequestParam(value = "provinceId", required = false) Integer provinceId,
                                                                 @RequestParam(value = "cityId", required = false) Integer cityId,
                                                                 @RequestParam(value = "countyId", required = false) Integer countyId);

    /**
     * USERCODE获取信息
     *
     * @param:
     * @return: map<userCode, empDTO>
     * @auther: tanjie
     * @since: 2019/10/22
     */
    @GetMapping("/emp/queryEmpInfoByUserCodes")
    @ApiOperation("批量获取顾问信息")
    RestResultResponse<Map<String, EmpDTO>> queryEmpInfoByUserCodes(@RequestBody DealerOrgInfoS dealerOrgAreaVO);

    /**
     * 根据orgId获得所有的人员信息
     *
     * @author 李贺
     * @since 2019/11/19
     */
    @GetMapping("/basedata/positions/getUserByOrgId")
    RestResultResponse<List<com.yonyou.cyxdms.sysmanage.client.vo.user.UserInfoVO>> getUserByOrgId(@RequestParam(value = "orgId") String orgId);


    /**
     * 远端调用获取经销商orgid
     *
     * @param orgId
     * @param appId
     * @param dealerCode
     * @param companyId
     * @param dealerName
     * @return
     * @auther: tanjie
     */
    @GetMapping("/dealerInfo/getDealerBysaleArea")
    RestResultResponse<List<DealerOrgAreaVO>> getDealerBySaleArea(@RequestParam(value = "orgId", required = false) String orgId,
                                                                  @RequestParam("appId") String appId,
                                                                  @RequestParam(value = "dealerCode", required = false) String dealerCode,
                                                                  @RequestParam("companyId") Long companyId,
                                                                  @RequestParam(value = "dealerName", required = false) String dealerName);


    /**
     * 通过userid获取经理的userid
     */
    @ApiOperation(value = "通过userid等获取经理的userid")
    @GetMapping("/basedata/users/getManagerIdByUserId")
    RestResultResponse<List<String>> getManagerIdByUserId(@RequestParam(value = "userId") String userId,
                                                          @RequestParam(value = "positionCode") String positionCode,
                                                          @RequestParam(value = "orgId") String orgId);

    /**
     * 获得所有经销商信息
     *
     * @auther: 李贺
     */
    @GetMapping("/dealerInfo/allDealer")
    RestResultResponse<List<DealerInfoParentVO>> getAllDealer(@RequestParam(value = "orgId", required = false) String orgId);


    /**
     * 获取所有事业部
     *
     * @return
     * @author 李贺
     * @since 2019/11/25
     */
    @GetMapping("/org/getBusinessOrg")
    RestResultResponse<List<OrgParentVO>> getBusinessOrg();
    /**
     * 获取所有部门
     *
     * @return
     * @author 王圣童
     * @since 2021/11/25
     */
    @GetMapping("/org/getBusinessOrgAll")
    RestResultResponse<List<OrgParentVO>> getBusinessOrgAll();


    /**
     * 获取所有部门
     *
     * @return
     * @author 王圣童
     * @since 2021/11/25
     */
    @GetMapping("/org/getBusinessOrgAllByAppId")
    RestResultResponse<List<OrgParentVO>> getBusinessOrgAllByAppId(@RequestParam("appId") String appId);


    /**
     * 通过code获取dealer
     *
     * @return
     * @author 马邢健
     * @since 2019/11/25
     */
    @GetMapping("/dealerInfo/getDealerByOwner")
    RestResultResponse<DealerInfoAVO> getDealerByOwner(@RequestParam(value = "ownerCode") String ownerCode);

    /**
     * 获得当前车厂的信息
     *
     * @return: 获得当前车厂的信息
     * @auther: 李贺
     * @since: 2019/11/26
     */
    @GetMapping("/company/org/factoryCompany")
    RestResultResponse<CompanyVO> factoryCompany();

    /**
     * 根据userName获得userId
     */
    @GetMapping("/basedata/users/getUserIdByName")
    RestResultResponse<List<Long>> getUserIdByName(@RequestParam("appId") String appId,
                                                   @RequestParam("ownerCode") String ownerCode,
                                                   @RequestParam("name") String name);

    /**
     * 根据userName获得userId
     */
    @GetMapping("/basedata/users/getUserIdByNameAndPositionCode")
    RestResultResponse<List<Long>> getUserIdByNameAndPositionCode(@RequestParam("appId") String appId,
                                                                  @RequestParam("ownerCode") String ownerCode,
                                                                  @RequestParam("name") String name);


    /**
     * 通过userCOde获取用户信息
     *
     * @auth tanjie
     */
    @GetMapping("/user/getUserIdByUserCode")
    RestResultResponse<UserDTO> getUserIdByUserCode(@RequestParam("userCode") String userCode,
                                                    @RequestParam("appId") String appId);

    /**
     * 车厂通过组织id（大区小区类型的组织）获取本车厂下对应的经销商
     *
     * @param orgId
     * @param:
     * @return: 车厂通过组织id（大区小区类型的组织）获取本车厂下对应的经销商
     * @auther: 马邢健
     * @since: 2019/10/31
     */
    @GetMapping("/company/org/getDealerBySaleArea")
    RestResultResponse<List<DealerOrgAreaVO>> getDealerBySaleArea(@RequestParam(value = "orgId", required = false, defaultValue = "") String orgId,
                                                                  @RequestParam(value = "dealerCode", required = false, defaultValue = "") String dealerCode,
                                                                  @RequestParam(value = "dealerName", required = false, defaultValue = "") String dealerName);

    /**
     * 根据组织id 获得组织信息
     *
     * @auther: 李贺
     * @since: 2019/12/6
     */
    @GetMapping("/org/getOrgByOrgIds")
    RestResultResponse<List<OrgParentVO>> getOrgByOrgIds(@RequestParam("orgIds") String orgIds);

    /**
     * 更新登录信息
     * 2019/12/10
     *
     * @param id
     */
    @PutMapping("/ttUserLogin/upLog")
    RestResultResponse<Void> upLog(@RequestParam("id") Long id, @RequestParam(value = "jwt", required = false) String jwt, @RequestParam(value = "type", defaultValue = "10041002") Integer type);

    /**
     * 获取树状图
     *
     * @author 李贺
     * @since 2019/12/12
     */
    @RequestMapping(value = "/company/org/tree", method = RequestMethod.GET)
    RestResultResponse<List<CompanyOrgMaintenanceTreeVO>> getOrgs();

    /**
     * 获取树状图
     *
     * @author 王圣童
     * @since 2021/12/2
     */
    @RequestMapping(value = "/company/org/drlTree", method = RequestMethod.GET)
    RestResultResponse<List<CompanyOrgMaintenanceTreeVO>> getDrlOrgs();


    /**
     * 获取车厂所有组织
     *
     * @author zys
     * @since 2020/02/05
     */
    @RequestMapping(value = "/company/org/allTree", method = RequestMethod.GET)
    RestResultResponse<List<CompanyOrgVO>> getOrgsNoCompanyId();

    //===============================   CMS  增加接口  开始     ============================================

    /**
     * 新增IM接口（PC通知)
     *
     * @author wangyan
     * @since 2019/12/18
     */
    @PostMapping("/notification/publishIM")
    public String publishIM(@RequestBody TextNotifyDto textNotifyDto);
    //===============================   CMS  增加接口  结束     ============================================

    /**
     * 获得经销商所属区域
     * 李贺
     *
     * @param
     * @return
     */
    @GetMapping("/dealerInfo/getSaleArea")
    RestResultResponse<List<OrgParentVO>> getSaleArea(@RequestParam("dealerIds") List<Long> dealerIds);

    /**
     * 获取经销商营业时间和门店图片
     * <p>
     * 李贺
     */
    @GetMapping("/dealerInfo/dealerPictures")
    RestResultResponse<List<DealerPictureVO>> getDealerPictures(@RequestParam(value = "dealerIds", required = false) String dealerIds,
                                                                @RequestParam(value = "dealerCodes", required = false) String dealerCodes);

    /**
     * 获取所有经销商
     *
     * @param appId
     * @return
     * @since tanjie
     */
    @GetMapping("/dealerInfo/getAllDealerCode")
    RestResultResponse<List<String>> getAllDealerCode(@RequestParam("appId") String appId);

    /**
     * 获取组织信息
     *
     * @return
     * @since tanjie
     */
    @PostMapping("/dealerInfo/getDealerBysaleAreaBatch")
    RestResultResponse<List<DealerOrgAreaVO>> getDealerBysaleAreaBatch(@RequestBody DealerOrgInfoS dealerOrgInfoS);

    /**
     * 新推送接口
     *
     * @auther: maxingjian
     * @since: 2019/12/24
     */
    @ApiOperation(value = "新推送接口", notes = "新推送接口")
    @PostMapping("/login/pushMsg")
    RestResultResponse<Void> pushMsg(@RequestBody PushMsgDTO pushMsgDTO);


    /**
     * 根据当前人的职位id获取角色类别getPositionByUserOrgId
     *
     * @auther: maxingjian
     * @since: 2019/12/24
     */
    @ApiOperation(value = "根据当前人的职位id获取角色类别", notes = "根据当前人的职位id获取角色类别")
    @GetMapping("/basedata/users/getPositionByUserOrgId")
    RestResultResponse<String> getPositionByUserOrgId(@RequestParam("userOrgId") Long userOrgId);

    @GetMapping({"/basedata/users/getUserPermissionCtrl"})
    RestResultResponse<Map> getUserPermissionCtrl();

    @GetMapping("/sysLogin/emp/getEmployeeByUserIds")
    RestResultResponse<List<EmployeeVO>> getEmployeeByUserIds(@ApiParam(name = "userIds", value = "人员ids", required = false) @RequestParam(value = "userIds", required = false, defaultValue = "") String userIds);

    /**
     * 检查是否离职
     */
    @GetMapping(value = "/user/checkEmployeeStatus")
    RestResultResponse<Integer> checkEmployeeStatus(@RequestParam("appId") String appId, @RequestParam("userId") Long userId);



    /**
     * 根据roleposition获取user
     *
     * @author MAXINGJIAN
     * @since 2019/9/18
     */
    @RequestMapping(method = RequestMethod.POST, value = "/basedata/roles/getPresetRoleByName", produces = "application/json;charset=UTF-8")
    public RestResultResponse<List<RoleVO>> getPresetRoleByName(@RequestBody List<String> names);


    /**
     * 查询所有人员
     */
    @GetMapping(value = "/basedata/users/getNameByAppId")
    RestResultResponse<List<UserEmpVO>> getNameByAppId(@RequestParam("appId") String appId);

    /**
     * 打印修改通知状态
     */

    @PutMapping(value = "/dealer/msgRecordManage/printUpdateStatus")
    public void printUpdateStatus(@RequestBody List<MsgRecordDTO> msgRecordDTO);
}
